//1、引入组件
import Home from "@/components/Home.vue"
import Mall from "@/components/Mall.vue"
import Find from "@/components/Find.vue"
import User from "@/components/User.vue"
import Ticket from "@/components/Ticket.vue"
import City from "@/components/City.vue"
import Search from "@/components/Search.vue"
import MainFooter from "@/components/MainFooter.vue"
import MainHeader from "@/components/MainHeader.vue"
import TodayDetail from "@/components/TodayDetail.vue"
import Hot from "@/components/hot.vue"
import Coming from "@/components/Coming.vue"
import Mdetail from "@/components/Mdetail.vue"
import Register from "@/components/Register.vue"


//2、定义路由规则
const routes = [
  {//重定向
    path:"/",
    redirect:"/home"
  },
  {
    path: "/home",
    name: "home",
    components: {
    	header:MainHeader,
      content: Home,
      footer: MainFooter
    }
  },
  {
    path: "/home/hot",
    name: "hot",
    components: {
    	header:MainHeader,
      content: Hot,
      footer: MainFooter
    }
  },
  {
    path: "/mdetail/:classid",
    name: "mdetail",
    components: {
    	header:MainHeader,
      content: Mdetail,
      footer: MainFooter
    }
  },
  {
    path: "/home/coming",
    name: "coming",
    components: {
    	header:MainHeader,
      content: Coming,
      footer: MainFooter
    }
  },
  {
    path: "/home/city",
    name: "city",
    components: {
    	header:MainHeader,
      content: City,
      footer: MainFooter
    }
  },
  {
    path: "/home/search",
    name: "search",
    components: {
    	header:MainHeader,
      content: Search,
      footer: MainFooter
    }
  },
  {
    path: "/todaydetail",
    name: "todaydetail",
    children:[
      {
        path:"/todaydetail/:classid",
        name:"todaydetail",
        component: TodayDetail
      }
    ],
    components: {
    	header:MainHeader,
      content: TodayDetail,
      footer: MainFooter
    }
  },
  {
    path: "/mall",
    name: "mall",
    components: {
    	header:MainHeader,
      content: Mall,
      footer: MainFooter
    }
  },
  {
    path: "/find",
    name: "find",
    components: {
    	header:MainHeader,
      content: Find,
      footer: MainFooter
    }
  },
  {
    path: "/user",
    name: "user",
    components: {
    	header:MainHeader,
      content: User,
      footer: MainFooter
    }
  },
  {
    path: "/register",
    name: "register",
    components: {
    	header:MainHeader,
      content: Register,
      footer: MainFooter
    }
  },
  {
    path: "/ticket",
    name: "ticket",
    components: {
    	header:MainHeader,
      content: Ticket,
      footer: MainFooter
    }
  }
]


export default routes;